/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.shinyray.project.entity;

import com.shinyray.org.entity.Orgnization;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;

/**
 * 应付帐款
 * @author Administrator
 */
@Entity
public class AccountPayable implements Serializable {
    @ManyToOne
    private Project project;

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    //依据协议
    @ManyToOne
    private CPP cpp;
    //支付对象
    @ManyToOne
    private Orgnization payToOrg;
    //支付者
    @ManyToOne
    private Orgnization payer;
    //应付款
    private float account;
    //币种
    private String currency;
    //应付日期
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date payDate;
    //费用类型
    private String feeType;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AccountPayable)) {
            return false;
        }
        AccountPayable other = (AccountPayable) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.shinyray.project.entity.AccountPayable[id=" + id + "]";
    }

    public float getAccount() {
        return account;
    }

    public void setAccount(float account) {
        this.account = account;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public Date getPayDate() {
        return payDate;
    }

    public void setPayDate(Date payDate) {
        this.payDate = payDate;
    }

    public Orgnization getPayToOrg() {
        return payToOrg;
    }

    public void setPayToOrg(Orgnization payToOrg) {
        this.payToOrg = payToOrg;
    }

    public Orgnization getPayer() {
        return payer;
    }

    public void setPayer(Orgnization payer) {
        this.payer = payer;
    }

    public String getFeeType() {
        return feeType;
    }

    public void setFeeType(String feeType) {
        this.feeType = feeType;
    }

    public CPP getCpp() {
        return cpp;
    }

    public void setCpp(CPP cpp) {
        this.cpp = cpp;
    }

    public Project getProject() {
        return project;
    }

    public void setProject(Project project) {
        this.project = project;
    }
    
}
